package com.free.mini.common.log;

/**
 *
 */
public enum DataMaskRuleEnum {
    ID_CARD("身份证号脱敏", "IDENTITY", "^(\\d{6})(\\d+)$", "$1******"),
    CARD_NO("卡号", "CARD_NO|CARDNO|CARD|CARD_NUMBER|CARDNUMBER|PREVIOUSCARDNUMBER|DEVICENUMBER|FORMFACTOR|OLDCARDNO|NEWCARDNO", "^(\\d{6})\\d+(\\d{4})$", "$1****$2"),
    CVV("CVV", "CVV|CVV2|CVV2CVC2", "^(\\d{3})$", "***"),
    PHONE("手机号脱敏", "PHONE|BANKPHONE|PHONE_NUM|PHONENUM|MOBILE", "^(\\d{3})\\d+(\\d{4})$", "$1****$2"),
    EMAIL("邮箱脱敏","EMAIL|ACCOUNTNAME","(\\w+)\\w{3}@(\\w+)","$1***@$2");

    DataMaskRuleEnum(String description, String fieldName, String regular, String result){
        this.description = description;
        this.fieldName = fieldName;
        this.regular = regular;
        this.result = result;
    }

    /**
     * 脱敏规则描述
     */
    public String description;
    /**
     * 要脱敏的属性名
     */
    public String fieldName;
    /**
     * 脱敏规则
     */
    public String regular;
    /**
     * 脱敏结果
     */
    public String result;
}